package com.lujianfei.android_actionbar;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    androidx.appcompat.widget.Toolbar toolbar;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        toolbar = findViewById(R.id.toolBar);
        setSupportActionBar(toolbar);

        findViewById(R.id.bt_sub_activity).setOnClickListener(this);
        findViewById(R.id.bt_immersive_activity).setOnClickListener(this);
        findViewById(R.id.bt_more_activity).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.bt_sub_activity:
            {
                startActivity(new Intent(this,BackActivity.class));
            }
            break;
            case R.id.bt_immersive_activity:
            {
                startActivity(new Intent(this,ImmersiveActivity.class));
            }
            break;
            case R.id.bt_more_activity:
            {
                startActivity(new Intent(this,MoreActivity.class));
            }
            break;
        }
    }
}
